import { ApiProperty } from '@nestjs/swagger';
import { IsNumber, IsOptional, IsBoolean, Min } from 'class-validator';

/**
 * 创建充值规则DTO
 */
export class CreateRechargeRuleDto {
  @ApiProperty({ description: '充值金额（单位：分）', example: 10000 })
  @IsNumber()
  @Min(0.01, { message: '充值金额不能少于0.01分' })
  rechargeAmount: number;

  @ApiProperty({ description: '赠送代金券金额（单位：分）', example: 1000 })
  @IsNumber()
  @Min(0)
  bonusVoucher: number;

  @ApiProperty({ description: '是否启用', example: true, required: false })
  @IsOptional()
  @IsBoolean()
  isActive?: boolean;
}